<%-- Copyright (c) 2001 BroadVision, Inc. All rights reserved              --%>
<%-- The product described in this manual may be protected by one or more  --%>
<%-- U.S. and International patents. The BroadVision One-To-One software   --%>
<%-- is covered by U.S. patent 5,710,887.                                  --%>
<%--                                                                       --%>
<%-- TRADEMARKS: BroadVision and the BroadVision logo are registered       --%>
<%-- trademarks, and BroadVision One-To-One is a trademark of BroadVision, --%>
<%-- Inc. IONA and Orbix are trademarks of IONA Technologies, Ltd. RSA,    --%>
<%-- MD5, and RC2 are trademarks of RSA Data Security, Inc. All other      --%>
<%-- trademarks, service marks, and trade names belong to their respective --%>
<%-- owners. BroadVision, Inc. disclaims any proprietary interest in the   --%>
<%-- marks and names of others.                                            --%>
<%--                                                                       --%>

<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-html-el.tld" prefix="html-el" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/bv-html.tld" prefix="bvhtml" %> 

<%@ page import="com.broadvision.visitor.client.Visitor" %>
<%@ page import="com.broadvision.web.servlet.SessionVisitor" %>

<c:set var="formBean" value="${emMessagePreviewForm}" />
<c:set var="formBeanMap" value="${formBean.map}" />
<c:set var="notifType" value="${formBeanMap.notifType}" />
<c:choose>
  <c:when test='${notifType == 0}'>
    <c:set var="actionPath" value="/em/notif/alertMessagePreview.do" />
  </c:when>
  <c:when test='${notifType == 1}'>
    <c:set var="actionPath" value="/em/notif/emailMessagePreview.do" />
  </c:when>
</c:choose>

<script language="javascript1.2">
  
function doAction(action, myform){
  myform.action = '<html:rewrite page="'+action+'" />';   
  myform.submit();
  return true;
}
  
</script>

<% SessionVisitor sessionVisitor = SessionVisitor.getInstance(request.getSession()); 
   Visitor visitor = sessionVisitor.getVisitor(); %>
   
<!--start zone 5 content area-->
<table class="zoneFive" width="100%" border="0" cellspacing="0" cellpadding="0" summary="content area">
  <tr>
    <td valign="top" width="100%">
		    
    <div class="pageTitle">
      <bean:message key="emarketing.notif.messagePreviewBody.label.message.preview" bundle="em"/>: 
      <bean:write name="emMessagePreviewForm" property="name"/>
    </div> 

    <!--start page tab area here-->
    <div><jsp:include page="/mc/common/pagetab.jsp" flush="true" /></div>

    
    <html-el:form action="${actionPath}">
        
        <!--start subtitle row-->
        <div class="pageSubtitle">
          <span class="left">
          
          <c:choose>
              <c:when test='${formBeanMap.canEdit}'>
                <c:choose>
                   <c:when test='${notifType == 0}'>
                     <bean:message key="emarketing.notif.messagePreviewBody.label.currentAlert" bundle="em"/> - 
                     <bean:write name="emMessagePreviewForm" property="name"/>
                   </c:when>
                   <c:when test='${notifType == 1}'>
                     <bean:message key="emarketing.notif.messagePreviewBody.label.currentEmail" bundle="em"/> - 
                     <bean:write name="emMessagePreviewForm" property="name"/>
                   </c:when>
                </c:choose>
              </c:when>
            </c:choose>   
          </span>
          <span class="right">
            <html:hidden property="oid" />
            <input type="button" class="titleButton" 
            <c:choose>
              <c:when test='${notifType == 0}'>
                value="<bean:message key="button.edit" bundle="em"/>" 
                onClick="doAction('/em/notif/alertMessageEdit.do', this.form);"/>
              </c:when>
              <c:when test='${notifType == 1}'>
                value="<bean:message key="button.edit" bundle="em"/>" 
                onClick="doAction('/em/notif/emailMessageEdit.do', this.form);"/>
              </c:when>
            </c:choose>
             
          </span>
        </div>
      
       <table class="labelForm" width="100%" border="0" cellspacing="0" cellpadding="0" summary="Email preview page">
	<tr>
          <td valign="top" class="labelField">
            <div>
              <bean:write name="emMessagePreviewForm" property="previewScript" filter="false" />
            </div>
          </td>
        </tr>
      </table>
      </html-el:form>
    </td>
  </tr>
</table>
  



